package avicit.bdp.dcs.desensitization.dto;

import avicit.bdp.common.base.BaseDTO;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.Id;
import avicit.platform6.core.annotation.log.LogField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import javax.persistence.Column;
import javax.persistence.Table;

/**
 * @金航数码科技有限责任公司
 * @作者：developer
 * @邮箱：developer@avic-digital.com
 * @创建时间： 2020-08-03 09:29
 * @类说明：脱敏规则实体类
 * @修改记录：
 */
@ApiModel(value = "DcsDesensitizationRuleDTO", description = "bdp_dcs_desensitization_rule")
@Table(name = "bdp_dcs_desensitization_rule")
public class DcsDesensitizationRuleDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    // 主键
    @Id
    @LogField
    @ApiModelProperty(value = "主键")
    @FieldRemark(column = "id", field = "id", name = "id")
    @javax.persistence.Id
    @Column(name = "id")
    private String id;

    // 脱敏规则名称
    @LogField
    @ApiModelProperty(value = "脱敏规则名称")
    @FieldRemark(column = "name", field = "name", name = "脱敏规则名称")
    @Column(name = "name")
    private String name;

    // 组织机构代码
    @ApiModelProperty(value = "组织机构代码")
    @FieldRemark(column = "org_identity", field = "orgIdentity", name = "组织机构代码")
    @Column(name = "org_identity")
    private String orgIdentity;

    // 密级
    @ApiModelProperty(value = "密级")
    @FieldRemark(column = "secret_level", field = "secretLevel", name = "密级")
    @Column(name = "secret_level")
    private String secretLevel;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getOrgIdentity() {
        return orgIdentity;
    }

    public void setOrgIdentity(String orgIdentity) {
        this.orgIdentity = orgIdentity;
    }

    public String getSecretLevel() {
        return secretLevel;
    }

    public void setSecretLevel(String secretLevel) {
        this.secretLevel = secretLevel;
    }

    @Override
    public String getLogFormName() {
        if (StringUtils.isEmpty(super.logFormName)) {
            return "脱敏规则管理";
        } else {
            return super.logFormName;
        }
    }

    @Override
    public String getLogTitle() {
        if (StringUtils.isEmpty(super.logTitle)) {
            return "脱敏规则";
        } else {
            return super.logTitle;
        }
    }

}